<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>AppRun Play</title>
  <link rel="stylesheet" href="lib/codemirror.css">
  <script src="lib/codemirror.js"></script>
  <script src="mode/javascript/javascript.js"></script>
  <script src="mode/xml/xml.js"></script>
  <script src="mode/jsx/jsx.js"></script>
  <script src="../dist/apprun-play.js"></script>
</head>
<body>
  <textarea style="width:100%; height:300px">
      const state = 0;
      const view = state => {
        return `<div>
          <h1>${state}</h1>
          <button onclick='app.run("-1")'>-1</button>
          <button onclick='app.run("+1")'>+1</button>
        </div>`;
      };
      const update = {
        '+1': state => state + 1,
        '-1': state => state - 1
      };
      app.start(document.body, state, view, update);
  </textarea>
  <apprun-play></apprun-play>

  <textarea>
<html>
<body>
<script src="https://unpkg.com/apprun/dist/apprun-html.js"></script>
<script>
  const view = state => `<div>${state}</div>`;
  app.start(document.body, 'hello world', view);
</script>
</body>
</html>
</textarea>
  <p>
    <apprun-play></apprun-play>
  </p>
</body>

</html>